<!DOCTYPE html>
<html>
  <head>
    <title>#(app.name)</title>
    <meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	
	<meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.
	">
	
	<link rel="stylesheet" href="#(CONTEXT_PATH??)/static/lib/weui/lib/weui.min.css">
	<link rel="stylesheet" href="#(CONTEXT_PATH??)/static/lib/weui/css/jquery-weui.css">
	<link rel="stylesheet" href="#(CONTEXT_PATH??)/static/lib/weui/demos/css/demos.css">
	<style type="text/css">
		.center{text-align: center;border:1px solid gray}
		.header{text-algin:center;background: #F7F7FA;font-size: 12px;width:100%;}
		.title{text-align: center;width:100%;color:red;}
		
		.btn{width:90%;}
	</style>
  </head>

  <body ontouchstart>

    <header class='header'>
      <h1 class="title">#(app.name)</h1>
    </header>
	<div>
		用户登录
	</div>
<div class="weui-cells weui-cells_form">
  <div class="weui-cell">
    <div class="weui-cell__hd"><label class="weui-label">用户名</label></div>
    <div class="weui-cell__bd">
      <input class="weui-input" id="username" type="text"  placeholder="请输入">
    </div>
  </div>
  <div class="weui-cell">
    <div class="weui-cell__hd"><label class="weui-label">密码</label></div>
    <div class="weui-cell__bd">
      <input class="weui-input" id="password" type="password"  placeholder="请输入">
    </div>
  </div>
  <br>
  <div class="weui-flex">
  <div class="weui-flex__item"><a href="javascript:login();" class="weui-btn weui-btn_primary btn">登录</a></div>
  <div class="weui-flex__item"><a href="#(CONTEXT_PATH??)/m/reg" class="weui-btn weui-btn_primary btn">去注册</a></div>
</div>
  
  
    <script src="#(CONTEXT_PATH??)/static/lib/weui/lib/jquery-2.1.4.js"></script>
	<script src="#(CONTEXT_PATH??)/static/lib/weui/lib/fastclick.js"></script>
	<script>
	  $(function() {
	    FastClick.attach(document.body);
	  });

	function login(){
		$.post("#(CONTEXT_PATH??)/user/mlogin",{
			username:$('#username').val(),
			password:$('#password').val()
		},function(data){
			if(data=='suc' || data=='state'){
				location.href="#(CONTEXT_PATH??)/m/goods";
			}else{
				$.toast('用户名或密码错误！', "forbidden");
			}
		});
	}
	</script>
	<script src="#(CONTEXT_PATH??)/static/lib/weui/js/jquery-weui.js"></script>
  </body>

</html>
